Skip to content

feat: why and history, from a run's kept logs - #21

Merged
HaoZeke merged 4 commits into
mainfrom
feat/why
Nov 17, 2026
Merged

HaoZeke merged 4 commits into
mainfrom
feat/why

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

eb-keep-logs why [RUN | --latest] [--target TARGET] [--root ROOT] [--json] reads the logs failed kept, plain or compressed by rotate, and prints for each failed easyconfig the package and easyconfig, the EasyBuild step it failed in, EasyBuild's message, and the line of the log that shows the error, with three lines either side, its path and its line number.

The line shown is the first compiler or linker error from the start of the failed step to EasyBuild's own error line, else that line: a GCC, Clang or nvcc error at a source line, or the undefined symbol or missing library GNU ld, lld or mold reports. Steps are EasyBuild 5's, read from its Starting STEP step records and its announcements on the terminal. A build that kept only its output is read from that, with EasyBuild's wrapping at 80 columns undone.

For a failure class, feed the kept log to eb-stack; why names the step and the error line only.

eb-keep-logs history PACKAGE lists each kept build of that package, run by run, with the target, the outcome and the duration EasyBuild printed. --json prints the same as one line with schema_version 1. The shell script refuses both commands, as COMPAT.md lists.

tests/fixtures/build-logs is the log tree of eight runs of GNU hello
2.12.1, built with EasyBuild 5.4.2 from EESSI 2025.06 with
EESSI-extend, laid out as eb-pipeline lays out its runs: RUN/TARGET/,
each easyconfig's output in NAME.stdout.log, its --tmp-logdir in
easybuild-logs/NAME, and eb-keep-logs failed run after each failed
build. The builds fail as builds do: a checksum of another release
(eb exits 42), a patch made for hello 2.10 (44), a dependency nobody
packaged (31), a configure that finds no working compiler (15), a
compile error and an undefined reference (16), a failing test (1) and
a sanity check path that is not there (45). One run holds two failed
builds and a second target that builds; the last run builds with both
toolchains. eb-keep-logs rotate compressed the first four runs.

The builds ran as alice on a host named node1, in a clean
environment, so the logs name no real user, host or site.
tests/corpus has the easyconfigs and patches, run.sh, which runs a
case as eb-pipeline runs a line, and make-fixtures.sh, which trims a
tree for the fixtures by dropping lines, never editing one: of each
kept session log, EasyBuild's warnings and errors and the records of
its messages, steps and shell commands stay, without the output of
the commands that succeeded or the middle of a failed command's output
longer than 160 lines. EasyBuild's own copies of its logs stay out.
The contributing guide says how to make the tree again, and CI runs
shellcheck on both scripts.
`eb-keep-logs why [RUN | --latest] [--target TARGET] [--root ROOT]
[--json]` reads the logs `failed` kept, plain or compressed by
`rotate`, and prints for each failed easyconfig the package and
easyconfig, the EasyBuild step it failed in, EasyBuild's message, and
the line of the log that shows the error, with three lines either
side, its path and its line number. A run's builds are read from its
own directory, as `failed` given the run as LOGDIR keeps them, and
from its target directories, as eb-pipeline keeps them.

The line shown is the first compiler or linker error from the start of
the failed step to EasyBuild's own error line, else that line: a GCC,
Clang or nvcc error at a source line, or the undefined symbol or
missing library GNU ld, lld or mold reports. EasyBuild's own error line
is its first "EasyBuild encountered an error" in the session log, and
its FAILED entry on the terminal. Steps are EasyBuild 5's, read from
its "Starting STEP step" records and its announcements on the terminal.
A build that kept no session log is read from its terminal output, with
EasyBuild's wrapping at 80 columns undone. The inflater leaves a gzip
member's CRC-32 and size unchecked, so why checks them.

why gives no failure class; for one, feed the kept log to eb-stack.

--json prints one line with schema_version 1, for eb-pipeline's run
summary. The shell script refuses why, as COMPAT.md lists.
tests/test_why.sh runs it on the real failures in
tests/fixtures/build-logs; the untrimmed logs give the same step,
message and error line.
`eb-keep-logs history PACKAGE [--target TARGET] [--root ROOT] [--json]`
goes through the runs under ROOT, oldest first, and lists the builds
whose NAME is PACKAGE or starts with PACKAGE and a dash, with their
target, their outcome and the duration EasyBuild printed. The outcome
is read from EasyBuild's output as why reads it; session logs are not
read, so a long tree stays quick to list. A module name, NAME/VERSION,
is taken as NAME-VERSION.

--json prints one line with schema_version 1. The shell script refuses
history, as COMPAT.md lists; tests/test_why.sh runs it on the same
fixtures as why.
A how-to runs why and history on the kept logs of the corpus's real
failed builds: the newest run, a named run, more of a log than why
shows, a package's builds over the runs, and why --json read with jq
for a script's own summary, with what to do when they find nothing.
The front page names both commands, and the pipeline how-to points to
the new one from its check.
@HaoZeke
HaoZeke merged commit 5a88422 into main Nov 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant